-
Notifications
You must be signed in to change notification settings - Fork 184
chore: Button Style API refactor #3752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3752 +/- ##
=======================================
Coverage 97.01% 97.01%
=======================================
Files 825 826 +1
Lines 23963 23965 +2
Branches 8427 8357 -70
=======================================
+ Hits 23248 23250 +2
Misses 666 666
Partials 49 49 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor style comment about the usages of ?.
(approving anyway since it's just a style thing). Other comment is just for me.
import { ButtonProps } from './interfaces'; | ||
|
||
export function getButtonStyles(style: ButtonProps['style']) { | ||
if (SYSTEM !== 'core' || !style?.root) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: just out of curiosity, I know we have this for bundlers/minifiers to remove, but I don't know how complex this is allowed to be. For example, are you allowed to combine it with other conditionals like this?
Do you know if there's a way to test this? Got curious, did some research:
- Webpack uses Terser, which removes replaced conditionals
- Vite uses esbuild, which does not
Oh well, probably need to come up with something smarter eventually. But that's for later, this isn't a valid reason to block this PR.
Description
Added
style
file for the Button component to maintain consistency across all Style API Components.How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.